package pl.edu.pk.mech.kkbus.datastore.common;

import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import com.google.appengine.api.datastore.AsyncDatastoreService;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.images.ImagesService;
import com.google.appengine.api.images.ImagesServiceFactory;
import com.google.appengine.api.mail.MailService;
import com.google.appengine.api.mail.MailServiceFactory;
import com.google.appengine.api.memcache.MemcacheService;
import com.google.appengine.api.memcache.MemcacheServiceFactory;
import com.google.appengine.api.taskqueue.Queue;
import com.google.appengine.api.taskqueue.QueueFactory;
import com.google.appengine.api.urlfetch.URLFetchService;
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.appengine.api.xmpp.XMPPService;
import com.google.appengine.api.xmpp.XMPPServiceFactory;

/**
 * @author O.Kamil
 * Fabryka zwracajaca instancje utilowych serwisow
 */
public class ServiceFactory {
	private ServiceFactory(){};
	
    /**
     * @return
     * Synchroniczna zapis do datastore
     */
    public static DatastoreService getDatastoreService() {
        return DatastoreServiceFactory.getDatastoreService();
    }
    
    /**
     * @return
     * Asynchroniczny zapis do datastore
     */
    public static AsyncDatastoreService getAsyncDatastoreService() {
        return DatastoreServiceFactory.getAsyncDatastoreService();
    }

    /**
     * @return
     * Instancja do obslugi cache
     */
    public static MemcacheService getMemcacheService() {
        return MemcacheServiceFactory.getMemcacheService();
	}

    /**
     * @return
     * Wysylanie rzadan HTTP do zewnetrznych serwerow
     */
    public static URLFetchService getURLFetchService() {
        return URLFetchServiceFactory.getURLFetchService();
	}

    /**
     * @return
     * Serwis z uslugami usera np. Task Queue
     */
    public static UserService getUserService() {
        return UserServiceFactory.getUserService();
    }

    /**
     * @return
     * Serwis do obslugi poczty elektronicznej
     */
    public static MailService getMailService() {
        return MailServiceFactory.getMailService();
    }

    /**
     * @return
     * Operacje na plikach graficznych po stronie serwera
     */
    public static ImagesService getImagesService() {
        return ImagesServiceFactory.getImagesService();
    }

    /**
     * @return
     * Domyslna kolejka
     */
    public static Queue getDefaultQueue() {
        return QueueFactory.getDefaultQueue();
    }

    /**
     * @return
     * Zarzadzanie wiadomosciami (Jabber)
     */
    public static XMPPService getXMPPService() {
        return XMPPServiceFactory.getXMPPService();
    }

    /**
     * @return
     * Serwis do obslugi duzych plikow (BlobStore)
     */
    public static BlobstoreService getBlobstoreService() {
        return BlobstoreServiceFactory.getBlobstoreService();
    }
}
